<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/element.css" />
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<link rel="stylesheet" type="text/css" href="css/bg1.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<script src="js/jquery-3.5.1.js"></script>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/element.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			[v-cloak] {
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="app"  v-cloak>
			<div class="page_root bg1_page">
				<el-card class="box-card" shadow="never">
					<div class="bg1_top">
						<span>广州市农作物种子质量检验中心</span>
					</div>
					<div class="title title1">检验报告</div>
					<div class="bg1_form">
						<el-form :model="form" label-width="140px">
							<el-row>
								<el-col :span="10":offset="14">
									<el-form-item label="报告编号:">
										<span>{{form.bgNo}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="作物种类:">
										<span>{{form.cropType}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="品种名称:">
										<span>{{form.cropName}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="样品登记号">
										<el-input v-model="form.ypNo" @input="ypNoInput"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="受检单位">
										<span>{{form.companyName}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="种子生产经营者:">
										<span>{{form.producer}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="商标或标识:">
										<span>{{form.registeredMark}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="标注的检测日期:">
										<span>{{form.bzDate}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="质量指标:">
										<span>{{form.qualityIndex}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="质量保证期:">
										<span>{{form.expiration}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="包装通透性情况:">
										<el-select v-model="form.permeability" placeholder="请选择" @change="permeabilitySelect">
											<el-option  label="通透" value="通透"></el-option>
											<el-option  label="不通透" value="不通透"></el-option>
										</el-select>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="扦样者:">
										<el-input v-model="form.samplingPerson"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="扦样日期:">
										<span>{{form.date}}</span>
									</el-form-item>
								</el-col>
							</el-row>

							<el-row>
								<el-col :span="10">
									<el-form-item label="扦样地点:">
										<span>{{form.sampleSite}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="扦(送)样单样品编号:">
										<span>{{form.sampleNo}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="种子批号:">
										<span>{{form.lotNum}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="种子批重(kg):">
										<span>{{form.count}}</span>
									</el-form-item>
								</el-col>
							</el-row>

							<el-row>
								<el-col :span="10">
									<el-form-item label="样品状态:">
										<el-input v-model="form.sampleStatus"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="样品重量(g):">
										<span>{{form.weight}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="检验类别:">
										<el-input v-model="form.testCate"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="检验项目:">
										<span>{{form.testItem}}</span>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="检验方法:">
										<el-input type="textarea" :rows="4" resize='none' v-model="form.testMethod" :disabled="true"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="10" :offset="4">
									<el-form-item label="判定依据:">
										<el-input type="textarea" :rows="4" resize='none' v-model="form.criterion" :disabled="true"></el-input>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="10">
									<el-form-item label="所用主要仪器:">
										<span>{{form.instrument}}</span>
									</el-form-item>
								</el-col>
								<el-col :span="10":offset="4">
									<el-form-item label="实验环境条件:">
										<el-input v-model="form.evn"></el-input>
									</el-form-item>
								</el-col>
							</el-row>

							<el-form-item label="检验结论:">
								<div class="conc">
									<div style="line-height: 26px;" @click="dialog=true">
										{{form.conclusion}}
									</div>
									<div style="text-align: right">
										<span>{{form.year}}年</span>
										<span style="margin-right: 100px" @click="dialog2=true">{{form.month}}</span>
									</div>
								</div>
							</el-form-item>
							<el-form-item label="备注:">
								<div class="conc">
									<div>{{form.remark}}</div>
								</div>
							</el-form-item>
							<el-row>
								<el-col :span="8">
									<el-form-item label="编制:">
										<el-select v-model="form.author" placeholder="请选择" @change="permeabilitySelect">
											<el-option v-for="item in authors" :key="item"  :label="item" :value="item"></el-option>
										</el-select>
									</el-form-item>
								</el-col>
								<el-col :span="8">
									<el-form-item label="审核:"></el-form-item>
								</el-col>
								<el-col :span="8">
									<el-form-item label="批准:"></el-form-item>
								</el-col>

							</el-row>
						</el-form>
					</div>
				</el-card>
			</div>
            <el-dialog title="检验结论" :visible.sync="dialog" width="50%">
                <el-form :model="form">
                    <el-form-item >
                        <el-input type='textarea' autosize v-model="form.conclusion" autocomplete="off"></el-input>
                    </el-form-item>
                </el-form>
            </el-dialog>
            <el-dialog :visible.sync="dialog2" width="50%">
                <el-form :model="form">
                    <el-form-item label="日期">
                        <el-date-picker v-model="month" type="date" format="MM月dd日" value-format="MM月dd日" @change="monthSet">
                        </el-date-picker>
                    </el-form-item>
                </el-form>
            </el-dialog>
		</div>

		<script>
			new Vue({
				el: '#app',
				data: {
					/** 基础参数 ***/
					/*****/
					authors:[],
                    dialog:false,
                    dialog2:false,
                    month:'',
					form: {
						author:'肖婉玉',
						sampleNo: 'GZJ2105001',
						companyName: '阿达',
						producer: 'asd',
						cropType: '水稻',
						cropName: '水稻',
						bzLabel: '包装标注检测日期',
						bzDate: '2021-09-10',
						expiration: '180天',
						lotNum: '120589623as',
						count: '12',
						weight: '3',
						sampleSite:'adw',
						registeredMark:'asdasda',
						testItem:'',
						testMethod:'dsds\r\nsdfsd',
						criterion:'dsd',
						permeability:'通透',
						instrument:'asd阿打算',
						samplingPerson:'asdasda',
						date:'2021-09-09',
						qualityIndex:'sdhsjsjdhfjsl',
						testCate:'asdasd',
						evn:'合格',
						sampleStatus:'sdsdsdsw',
						ypNo:'DJ',
						bgNo:'BJ',
						year:'',
                        month:'',
						remark:''
					}
				},
				watch: {
					// form监听
				    form: {
						handler: function(val) {
							var bg2 = window.cache.getItemData(this.index,'bg2');
							bg2.bgNo = val.bgNo;
							bg2.ypNo = val.ypNo;
							var fy = window.cache.getItemData(this.index,'fy')
							fy.bgNo = val.bgNo;


						},
						deep: true
				    }
				
				} ,
				created() {
					window.cache = window.parent.cache;
					var href = location.href
					this.index = href.substring(href.lastIndexOf("=")+1) - 1
					this.getData(this.index)
					this.init()
				},
				methods: {

					permeabilitySelect(){

					},
					ypNoInput(){
						var val = this.form.ypNo.substring(2);
						this.form.bgNo = 'BJ' + val
					},
                    monthSet(val){
					    this.form.month = val
                    },
					/***********************/
					getData(){
						var obj = window.cache.getItemData(this.index,'bg1')
						var fy = window.cache.getItemData(this.index,'fy')
						var xcjl = window.cache.xcjl

                        // 取封页的检验类别
                        // obj.testCate = fy.testCategory
						this.form = obj
						this.form.samplingPerson = xcjl.operator.join('、')

						var first = window.cache.getItemData(0,'bg1')
						var no = first.ypNo
						var v1 = no.substring(0,2);
						var v2 = no.substring(2);
						if(v2){
							v2 = parseInt(v2) + parseInt(this.index)
						}
						this.form.ypNo = v1 + v2
						this.form.bgNo = 'BJ' + v2
					},
					init(){
						this.authors = window.cache.employee
					}
				}
			})
		</script>
	</body>
</html>
